package com.jia.train.global.utils;

import cn.hutool.core.util.IdUtil;

public class SnowIdUtil {
    // 数据中心id
    private static final Integer CITY_WORKER_ID = 1;
    // 机器id
    private static final Integer MACHINE_ID = 2;

    public static Long getLongSnowNextId() {
        return IdUtil.getSnowflake(CITY_WORKER_ID, MACHINE_ID).nextId();
    }

    public static String getStringSnowNextId() {
        return IdUtil.getSnowflake(CITY_WORKER_ID, MACHINE_ID).nextIdStr();
    }


}
